home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-9.10-netbook-remix-PL.iso / casper / filesystem.squashfs / usr / share / doc / alsa-utils / README.init.cs4236 < prev   
Text File  |  2009-10-20  |  1KB  |  46 lines

  1. #! /bin/bash
  2.  
  3. ## Provided by Mkarcher at http://www.thinkwiki.org/wiki/Script_for_configuring_the_CS4239_sound_chip_in_PnP_mode
  4. ## Modified by Daniel T Chen for Debian/Ubuntu, redistributable
  5. ## under GPLv2 or later
  6.  
  7. for dev in /sys/bus/pnp/devices/*
  8. do
  9.   grep CSC0100 $dev/id > /dev/null && WSSDEV=$dev
  10.   grep CSC0110 $dev/id > /dev/null && CTLDEV=$dev
  11. done
  12.  
  13. echo activate > $WSSDEV/resources
  14. echo activate > $CTLDEV/resources
  15.  
  16. { read
  17.  read bla port1
  18.  read bla port2
  19.  read bla port3
  20.  read bla irq
  21.  read bla dma1
  22.  read bla dma2
  23.  # Hack: with PnPBIOS: ports are: port1: WSS, port2: OPL, port3: sb (unneeded)
  24.  #       with ACPI-PnP:ports are: port1: OPL, port2: sb, port3: WSS
  25.  # (ACPI bios seems to be wrong here, the PnP-card-code in snd-cs4236.c uses the
  26.  #  PnPBIOS port order)
  27.  # Detect port order using the fixed OPL port as reference
  28.  if [ ${port2%%-*} = 0x388 ]
  29.  then
  30.    # PnPBIOS: usual order
  31.    port=${port1%%-*}
  32.    oplport=${port2%%-*}
  33.  else
  34.    # ACPI: mixed-up order
  35.    port=${port3%%-*}
  36.    oplport=${port1%%-*}
  37.  fi
  38.  } < $WSSDEV/resources
  39.  
  40. { read
  41.  read bla port1
  42.  cport=${port1%%-*}
  43. } < $CTLDEV/resources
  44.  
  45. modprobe snd-cs4236 port=$port cport=$cport fm_port=$oplport irq=$irq dma1=$dma1 dma2=$dma2 isapnp=0
  46.